package com.bluesky.jwf.component.validator;

public class RequiredValidator extends StringValidator {

	public RequiredValidator() {

	}

	@Override
	public void init(String html) {

		super.init(html);
		setMessage("Required");
	}

	@Override
	public void validate() {

		String s = stringField.getString();

		if (s != null && !s.trim().isEmpty())
			setResult(true);
		else
			setResult(false);

	}

	public static void main(String[] args) {
		Object o = new RequiredValidator();
	}
}
